<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_JS运算符</title>
</head>
<body>
<script>
console.log(6/2);
console.log(3/2);
//如果比较运算符任意一边有数字，会先将非数字的值转为数字再进行比较
console.log(3>10);
console.log(3>'10');
console.log('3'>10);
//字符之间比较的是编码值
//‘1038611’.charCodeAt(2)查看指定下标处字符的编码值，如果不写方法参数看的是第一个字符的编码值
console.log('超'>'宇');
console.log('超'.charCodeAt());
console.log('宇'.charCodeAt());
console.log('3'>'10');//true
console.log('3'.charCodeAt());//51
console.log('1038611'.charCodeAt(0));//49

let a=1;
let b=true;
console.log(a ==b);//松散比较运算符 true 先将true转为数值，值都是1
console.log(a ===b);//严格比较运算符  false 先比较数据类型，再比较值number≠boolean

let c=0;
console.log(c==0?'yes':'no');//YES
console.log(c=0?'yes':'no');//NO
</script>
</body>
</html>